1. Technical Field
The present invention relates in general to the field of computers, and, in particular, to computer memories. Still more particularly, the present invention relates to an improved method and system for improving the performance of cache memories in a multiprocessor computer system.
2. Description of the Related Art
Under a typical prior art method of utilizing cache memories in a multiprocessor computer system, common data used by multiple processors is mapped (cached) from a main memory to a cache memory of one or more of the multiple processors in the multiprocessor computer system. Under this traditional method of caching, initially each cache memory of each processor of the multiprocessor computer system may contain a valid copy of the common data. However, after a first processor writes an update to the common data into its cache, only that first processor""s cache contains a valid copy of the common data. Whenever another processor needs to read or write to (change) the common data, it will xe2x80x9cmissxe2x80x9d the cached common data since the valid data is only in the first processor""s cache. For example, in a multiprocessor computer having four processors, and assuming that the data is written to frequently, there is a 25% chance that the requesting processor will have the most current common data in its local cache, and thus a cache xe2x80x9chitxe2x80x9d occurs when that common data is accessed. The same probability states that there is a 75% chance that the most current common data being requested will be in the cache of one of the other three processors, and thus the requesting processor will incur a cache xe2x80x9cmiss.xe2x80x9d A cache xe2x80x9cmissxe2x80x9d requires the requesting processor to then xe2x80x9csnoopxe2x80x9d the caches of the other processors for the requested common data, or to go to main memory if none of those caches have the requested data. The description and percentages above assume that each processor has previously cached and is able to change the requested data.
The present invention recognizes the need to improve the hit ratio of a cache memory in a multiprocessor computer. The present invention therefore is a method and system for allocating and storing data to the cache memory in each processor in a multiprocessor computer system. Data structures in a main memory are partitioned into substructures that are classified as either exclusive substructures or sharing substructures. The exclusive substructures are cached exclusively by a specified processor, and the sharing substructures are cached by specified groups of processors in the multiprocessor computer. The classified partitioning results in an improved cache hit ratio compared to cache hit ratios found in standard caching schemes. This improvement over standard caching schemes becomes greater as the number of processors in the multiprocessor computer increases.
The above, as well as additional objectives, features, and advantages of the present invention will become apparent in the following detailed written description.